# debug_structure.py
import os
import sys

def check_project_structure():
    print("=== 项目结构诊断 ===")
    
    # 获取当前目录
    current_dir = os.getcwd()
    print(f"当前目录: {current_dir}")
    
    # 检查关键目录和文件
    paths_to_check = [
        "src",
        "src/ui",
        "src/ui/tkinter", 
        "src/core",
        "src/storage",
        "src/ui/tkinter/main_window.py",
        "src/core/item_manager.py",
        "src/storage/file_manager.py"
    ]
    
    print("\n=== 检查文件和目录 ===")
    for path in paths_to_check:
        full_path = os.path.join(current_dir, path)
        exists = os.path.exists(full_path)
        status = "✅ 存在" if exists else "❌ 缺失"
        print(f"{status}: {path}")
    
    # 检查Python路径
    print("\n=== Python路径 ===")
    for i, path in enumerate(sys.path):
        print(f"{i}: {path}")

if __name__ == "__main__":
    check_project_structure()